﻿using UMLSynthesizer.Tasks;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using TaskLauncher.ViewModel;
using TaskLauncher.View;

namespace TaskLauncher
{
    public partial class App : Application
    {
        App()
        { }

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            LauncherWindow launcherWindow = new LauncherWindow();
            LauncherWindowViewModel launcherWindowViewModel = new LauncherWindowViewModel(e.Args);

            EventHandler handler = null;
            handler = delegate
            {
                launcherWindowViewModel.RequestClose -= handler;
                launcherWindow.Close();
            };
            launcherWindowViewModel.RequestClose += handler;

            launcherWindow.DataContext = launcherWindowViewModel;
            launcherWindow.Show();
        }
    }
}
